< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03103800.xhp

(section: findobject) (bookmark: bm_id3145136)
FindObject function

FindObject 関数

FindObject Function [Runtime]
FindObject 関数 [実行時](hd_id3145136.1)

Enables an object to be addressed at run-time as a string parameter through the object name.
文字列パラメータにオブジェクト名を指定することで、実行時に該当オブジェクトへアクセスします。(par_id3155341.2)

(/section: findobject)

For example, the following command:
たとえば、下記のコマンドを行ったとします。(par_id3150669.3)

MyObj.Prop1.Command = 5
MyObj.Prop1.Command = 5(par_id3148473.4)

corresponds to the command block:
この処理は、下記のコマンドブロックに対応します。(par_id3156023.5)

Dim ObjVar as Object
Dim ObjVar as Object(par_id3153896.6)

Dim ObjProp as Object
Dim ObjProp as Object(par_id3154760.7)

ObjName As String = "MyObj"
ObjName As String = "MyObj"(par_id3145069.8)

ObjVar = FindObject( ObjName As String )
ObjVar = FindObject( ObjName As String )(par_id3154939.9)

PropName As String = "Prop1"
PropName As String = "Prop1"(par_id3150793.10)

ObjProp = FindPropertyObject( ObjVar, PropName As String )
ObjProp = FindPropertyObject( ObjVar, PropName As String )(par_id3154141.11)

ObjProp.Command = 5
ObjProp.Command = 5(par_id3156424.12)

This allows names to be dynamically created at run-time. For example:
これを利用して、実行時に名前を動的に定義できます。たとえば、(par_id3145420.13)

"TextEdit1" to TextEdit5" in a loop to create five control names.
ループを使用して「TextEdit1」から「TextEdit5」の 5 つのコントロール名を作成します。(par_id3153104.14)

See also: FindPropertyObject
次も参照してください:FindPropertyObject(par_id3150767.15)

Syntax:
構文:(hd_id3150868.16)

FindObject( ObjName As String )
FindObject( ObjName As String )(par_id3151042.17)

Parameters:
パラメータ:(hd_id3159254.18)

ObjName: String that specifies the name of the object that you want to address at run-time.
ObjName: 実行時にアクセスするオブジェクト名を指定する文字列。(par_id3150439.19)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

(embed text/sbasic/shared/00000003.xhp#err12 : linkinfo)

12 Variable undefined
12 変数が未定義です (par_id3153013.48)

(/embed text/sbasic/shared/00000003.xhp#err12)


< Prev / Next >